home *** CD-ROM | disk | FTP | other *** search
/ Aminet 50 / Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso / Aminet / text / edit / tecoc-146.lha / tecoc.h < prev    next >
Text File  |  1993-06-19  |  31KB  |  700 lines

  1. /*****************************************************************************
  2.     Tecoc.h
  3.  
  4.     This file contains most of the definitions needed by TECO-C files.
  5. *****************************************************************************/
  6.  
  7. #define TVERSION 146        /* version number of TECO-C */
  8.  
  9. /*****************************************************************************
  10.     Bit masks for ED mode control flag.  The ones that are commented out
  11. are not used in TECO-C.  They are included here because they are used by
  12. TECO-11, and may be implemented in TECO-C someday.
  13.  
  14. *****************************************************************************/
  15.  
  16. #define ED_CARET_OK    1    /* don't use "^" as control-char prefix */
  17. #define ED_YANK_OK    2    /* let yanks clear text buffer */
  18. /*#define ED_NO_EXP    4*/    /* don't allow arbitrary expansions */
  19. #define ED_PRES_DOT    16    /* preserve "dot" on failing searches */
  20. /*#define ED_IMMED_OK    32*/    /* allow immediate escape-sequence commands */
  21. #define ED_DOT_BY_ONE    64    /* move dot by one on iter. search failure */
  22. /*#define ED_NO_W    128*/    /* don't do automatic "^W" before prompt */
  23. #define ED_FF           128     /* do not stop read on FF */
  24. #if defined(unix) || defined(AMIGA)
  25. #define ED_UNIXNL    256    /* use Unix-style newline line terminators */
  26. #endif
  27. #define ED_VTGR        512
  28. #define ED_NOSCDEL    1024    /* old style delete handler */
  29. #define ED_BTEE        2048    /* use BTEE instead of DIAMOND */
  30. #define ED_STDOUT    4096    /* use standout for doeves pointer */
  31. #define ED_INVCR    8192    /* don't show CR in scope - closer to TECO-11
  32.     but really not as good in my opinion (Mark Henderson)*/
  33.  
  34. /*****************************************************************************
  35.     Value for EH flag.
  36. *****************************************************************************/
  37.  
  38. #define EH_COMMAND    4    /* on error,  output failing command string */
  39.  
  40. /*****************************************************************************
  41.     Bit masks for ET mode control flag.  The ones that are commented out
  42. are not used in TECO-C.  They are included here because they are used by
  43. TECO-11.  The 2048 bit is listed as "reserved for TECO-8" in the TECO-11
  44. source code.  I needed another bit, so I used it.
  45. *****************************************************************************/
  46.  
  47. #define ET_IMAGE_MODE    1    /* output without doing conversions */
  48. #define ET_SCOPE    2    /* use scope for delete and control-U */
  49. #define ET_READ_LOWER    4    /* accept lowercase input */
  50. #define ET_NO_ECHO    8    /* don't echo input on control-T */
  51. /*#define ET_CAN_CTRL_O    16*/    /* (TECO-11) cancel control-O on output */
  52. #define ET_NO_WAIT    32    /* read with no wait on control-T */
  53. /*#define ET_DETACH    64*/    /* process detached flag */
  54. #define ET_MUNG_MODE    128    /* mung mode */
  55. /*#define ET_TRUNCATE    256*/    /* (TECO-11) truncate lines on output */
  56. #define ET_WAT_SCOPE    512    /* "WATCH" code exists, terminal is scope */
  57. #define ET_WAT_REFRESH    1024    /* "WATCH" code exists, terminal is refresh */
  58. #define ET_BKSP_IS_DEL    2048    /* treat BACKSPACE like DEL on input */
  59. #define ET_EIGHTBIT    4096    /* it's an eight-bit terminal */
  60. #define ET_ACCENT_GRAVE    8192    /* accept ` as escape (for VT220 terminals) */
  61. #define ET_VT200    16384    /* special VT200 mode */
  62. #define ET_TRAP_CTRL_C    0100000    /* trap control-C */
  63.  
  64. /*****************************************************************************
  65.     Values for EU flag.
  66. *****************************************************************************/
  67.  
  68. #define EU_NONE        -1    /* no case flagging of any type */
  69. #define EU_LOWER    0    /* flag lowercase characters on output */
  70. #define EU_UPPER    1    /* flag uppercase characters on output */
  71.  
  72. /*****************************************************************************
  73.     These identifiers are bit masks for elements of the ChrMsk array.
  74. The ChrMsk array is used by the macros defined in the ChrMac.h file and by
  75. the ReadCS function to make the character input code fast.  See the comment
  76. above the definition of the ChrMsk array in file TECOC.C.
  77. *****************************************************************************/
  78.  
  79. #define RCS_AST        '\1'    /* asterisk */
  80. #define RCS_BS        '\2'    /* backspace */
  81. #define RCS_CCH        '\3'    /* control char other than ^G, ^U or ^Z */
  82. #define RCS_CR        '\4'    /* carriage return */
  83. #define RCS_CTG        '\5'    /* control-G */
  84. #define RCS_CTU        '\6'    /* control-U */
  85. #define RCS_CTZ        '\7'    /* control-Z */
  86. #define RCS_DEF        '\10'    /* char other than RCS_AST, RCS_BS, etc. */
  87. #define RCS_DEL        '\11'    /* delete */
  88. #define RCS_GRV        '\12'    /* accent grave */
  89. #define RCS_LF        '\13'    /* line feed */
  90. #define RCS_LWR        '\14'    /* lowercase character */
  91. #define RCS_SP        '\15'    /* space */
  92. #define RCS_VF        '\16'    /* vertical tab or form feed */
  93. #define RCS_CTC        '\17'    /* control-C */
  94. #define CM_DIGIT    '\20'    /* digits */
  95. #define CM_LINE_TERM    '\40'    /* line terminators (lf, vt, ff) */
  96. #define CM_LOWER    '\100'    /* lowercase */
  97. #define CM_UPPER    '\200'    /* uppercase */
  98.  
  99. /*****************************************************************************
  100.     These identifiers are set by the search commands.  They provide a way
  101. for the search commands to all rely on common code,  even when the commands
  102. behave slightly differently.  It's a terrible way to code,  but it was only
  103. done in the search code.
  104. *****************************************************************************/
  105.  
  106. #define E_SEARCH  1    /* E_ command */
  107. #define FB_SEARCH 2    /* FB command */
  108. #define FK_SEARCH 3    /* FK command */
  109. #define N_SEARCH  4    /* N command */
  110. #define S_SEARCH  5    /* S command */
  111. #define U_SEARCH  6    /* _ command */
  112.  
  113. /*****************************************************************************
  114.     Identifiers for indices into the IFiles and OFiles arrays.
  115. *****************************************************************************/
  116.  
  117. #define    NOFDBS    3    /* number of output file data blocks */
  118.  
  119. #define    POUTFL    0    /* primary output stream */
  120. #define    SOUTFL    1    /* secondary output stream */
  121. #define    EPRCFL    2    /* output stream used by E% command */
  122.  
  123. #define    PINPFL    0    /* primary input stream */
  124. #define    SINPFL    1    /* secondary input stream */
  125. #define    EQFL    2    /* input stream used by EQ command */
  126. #define EIFL    3    /* first input stream used by EI command */
  127.  
  128. /*****************************************************************************
  129.     Identifiers for :EG special function types.
  130. *****************************************************************************/
  131.  
  132. #define EG_INI        1    /* inititalization macro */
  133. #define EG_LIB        2    /* default macro library directory */
  134. #define EG_MEM        3    /* last-file-edited memory */
  135. #define EG_VTE        4    /* filename of video macro */
  136. #define EG_OTHER    5    /* system-specific :EG command */
  137. #define CLEAR_VAL    1
  138. #define GET_VAL        2
  139. #define SET_VAL        3
  140.  
  141. /*****************************************************************************
  142.     Function return codes.
  143. *****************************************************************************/
  144.  
  145. #define FAILURE   (-1)    /* function return status */
  146. #define SUCCESS   0    /* function return status */
  147. #define FILENF    3    /* "file not found", returned by ZSWild and ZOpInp */
  148.  
  149. /*****************************************************************************
  150.     CmdMod Bits.
  151. *****************************************************************************/
  152.  
  153. #define ATSIGN    '\1'    /* mask of "at sign" bit in CmdMod */
  154. #define COLON     '\2'    /* mask of "colon" bit in CmdMod */
  155. #define DCOLON    '\4'    /* mask of "double colon" bit in CmdMod */
  156. #define MARGIS    '\10'    /* mask of "m defined" bit in CmdMod */
  157.  
  158. /*****************************************************************************
  159.     Arguments to ZSetTT function.
  160. *****************************************************************************/
  161.  
  162. #define TT8BIT     1    /* whether terminal can handle 8-bit characters */
  163. #define TTWIDTH  2    /* number of columns of charactes */
  164. #define TTHEIGHT 3    /* number of rows of characters */
  165.  
  166. /*****************************************************************************
  167.     Miscellaneous identifiers.
  168. *****************************************************************************/
  169.  
  170. #define FFLINS    5    /* number of blank lines displayed for form feed */
  171. #define INFINITE  -1L    /* loop count value for infinite loops */
  172.  
  173. #define PRIMARY   '\0'    /* primary input or output stream specifier */
  174. #define SECNDARY  '\1'    /* secondary input or output stream specifier */
  175.  
  176. #define OPERAND   0    /* means element is an integer */
  177. #define OPERATOR  1    /* means element is + - * / & or | */
  178.  
  179. #define LOWER     0    /* case conversion mode specifier, for ^V, ^W */
  180. #define NONE      1    /* case conversion mode specifier */
  181. #define UPPER     2    /* case conversion mode specifier, for ^V, ^W */
  182.  
  183. /*****************************************************************************
  184.     define structure for expression stack
  185. *****************************************************************************/
  186.  
  187. struct EStck {
  188.     LONG Elemnt;        /* integer or operand character */
  189.     int ElType;        /* Entry's type: OPERATOR or OPERAND */
  190. };
  191.  
  192. /*****************************************************************************
  193.     define structure for loop stack
  194. *****************************************************************************/
  195.  
  196. struct LStck {
  197.     LONG    LIndex;        /* loop repetition count */
  198.     charptr LAddr;        /* pointer to start of loop in command buf */
  199. };
  200.  
  201. /*****************************************************************************
  202.     define structure for q-registers
  203. *****************************************************************************/
  204.  
  205. struct QReg  {
  206.     charptr    Start;        /* start of text */
  207.     charptr    End_P1;        /* end of text, plus one */
  208.     LONG    Number;        /* numeric part of q-register */
  209. };
  210.  
  211. /*****************************************************************************
  212.     define structure for macro stack
  213. *****************************************************************************/
  214.  
  215. struct MStck {
  216.     charptr    CStBeg;        /* saves CStBeg */
  217.     charptr    CBfPtr;        /* saves CBfPtr */
  218.     charptr    CStEnd;        /* saves CStEnd */
  219.     WORD    EStBot;        /* saves EStBot */
  220.     WORD    EStTop;        /* saves EStTop */
  221.     WORD    LStBot;        /* saves LStBot */
  222.     WORD    LStTop;        /* saves LStTop */
  223.     QRptr    QRgstr;        /* local q-register table */
  224. };
  225.  
  226. /*****************************************************************************
  227.     Debugging macros
  228. *****************************************************************************/
  229.  
  230. #if DEBUGGING
  231. #define DBGFEN(lv,fnm,msg) static char *DbgFNm = fnm; DbgFEn(lv, DbgFNm, msg)
  232. #define DBGFEX(lv,fnm,msg) DbgFEx(lv, fnm, msg)
  233. #define DBGFMS(lv,fnm,msg) DbgFMs(lv, fnm, msg)
  234. #else
  235. #define DBGFEN(lv,fnm,msg)
  236. #define DBGFEX(lv,fnm,msg)
  237. #define DBGFMS(lv,fnm,msg)
  238. #endif
  239.  
  240. /*****************************************************************************
  241.     function definitions
  242. *****************************************************************************/
  243.  
  244. #if USE_PROTOTYPES
  245.  
  246. #if CHECKSUM_CODE
  247. VVOID    init_code_checksums(void);
  248. VVOID    check_code_checksums(void);
  249. #endif
  250.  
  251. #if CONSISTENCY_CHECKING
  252. VVOID    init_consistency_check(void);
  253. VVOID    check_consistency(void);
  254. #endif
  255.  
  256. DEFAULT    BakSrc(void);        /* backwards search to match 1st character */
  257. DEFAULT BldStr(            /* build a string */
  258.     charptr XBfBeg,        /* beginning of build-string buffer */
  259.     charptr XBfEnd,        /* end of build-string buffer */
  260.     charptr (*XBfPtr));    /* pointer into build-string buffer */
  261. VVOID    ClenUp(void);        /* clean up for TECO-C abort */
  262. DEFAULT    CMatch(            /* match a character */
  263.     BOOLEAN *SamChr);    /* returned match indicator */
  264. #if DEBUGGING
  265. DEFAULT    DbgDsp(void);        /* debugging, control debugging display (^P) */
  266. VVOID    DbgFEn(            /* debugging, function entry */
  267.     int DbgFLv,             /*   function display level */
  268.     char *DbgFNm,        /*   function name */
  269.     char *DbgMsg);        /*   an entry message, usually parameters */
  270. VVOID    DbgFEx(            /* debugging, function exit */
  271.     int DbgFLv,        /*   function display level */
  272.     char *DbgFNm,        /*   function name */
  273.     char *DbgMsg);        /*   an exit message, usually return value */
  274. VVOID    DbgFMs(            /* debugging, function message */
  275.     int DbgFLv,        /*   function display level */
  276.     char *DbgFNm,        /*   function name */
  277.     char *DbgMsg);        /*   an message */
  278. #endif
  279. DEFAULT    DoCJR(            /* do C, J or R stuff */
  280.     LONG HowFar);        /* positive or negative displacement */
  281. VVOID    DoEvEs(            /* do an EV or ES mode control flag function */
  282.     WORD Flag);
  283. DEFAULT    DoFlag(            /* handle mode control flag */
  284.     WORD *Flag);
  285. VVOID    EchoIt(            /* echo a character to to terminal */
  286.     unsigned char Charac);
  287. VVOID    ErrChr(            /* display error message with character arg */
  288.     WORD ErrNum,        /* the error number */
  289.     unsigned char EChr);    /* character to imbed in message */
  290. VVOID    ErrMsg(            /* display error message */
  291.     WORD ErrNum);        /* the error number */
  292. VVOID    ErrPSt(            /* display error message with string arg */
  293.     WORD ErrNum,        /* the error number */
  294.     charptr EBeg,        /* string to imbed in message */
  295.     charptr EPtr);        /* ptr to end-of-string, plus one */
  296. VVOID    ErrStr(            /* display error message with string arg */
  297.     WORD ErrNum,        /* the error number */
  298.     char *EStr);        /* string to imbed in message */
  299. VVOID    ErrUTC(void);        /* unterminated command or macro */
  300. VVOID    ErrVrb(            /* display a verbose error message */
  301.     WORD ErrNum);        /* error message number */
  302. DEFAULT    ExeA(void);        /* execute an A command */
  303. DEFAULT    ExeAtS(void);        /* execute an at-sign (@) command */
  304. DEFAULT    ExeB(void);        /* execute a B command */
  305. DEFAULT    ExeBar(void);        /* execute a bar (|) command */
  306. DEFAULT    ExeBSl(void);        /* execute a backslash (\) command */
  307. DEFAULT    ExeC(void);        /* execute a C command */
  308. DEFAULT    ExeCCC(void);        /* execute a control-^ command */
  309. DEFAULT    ExeCln(void);        /* execute a colon (:) command */
  310. DEFAULT    ExeCom(void);        /* execute a comma (,) command */
  311. DEFAULT    ExeCrt(void);        /* execute a caret (^) command */
  312. DEFAULT    ExeCSt(void);        /* execute a command string */
  313. DEFAULT    ExeCtA(void);        /* execute a control-A command */
  314. DEFAULT    ExeCtC(void);        /* execute a control-C command */
  315. DEFAULT    ExeCtD(void);        /* execute a control-D command */
  316. DEFAULT    ExeCtE(void);        /* execute a control-E command */
  317. DEFAULT    ExeCtI(void);        /* execute a control-I (tab) command */
  318. DEFAULT    ExeCtL(void);        /* execute a control-L (form feed) command */
  319. DEFAULT    ExeCtN(void);        /* execute a control-N command */
  320. DEFAULT    ExeCtO(void);        /* execute a control-O command */
  321. DEFAULT    ExeCtP(void);        /* execute a control-P command */
  322. DEFAULT    ExeCtQ(void);        /* execute a control-Q command */
  323. DEFAULT    ExeCtR(void);        /* execute a control-R command */
  324. DEFAULT    ExeCtS(void);        /* execute a control-S command */
  325. DEFAULT    ExeCtT(void);        /* execute a control-T command */
  326. DEFAULT    ExeCtU(void);        /* execute a control-U command */
  327. DEFAULT    ExeCtV(void);        /* execute a control-V command */
  328. DEFAULT    ExeCtW(void);        /* execute a control-W command */
  329. DEFAULT    ExeCtX(void);        /* execute a control-X command */
  330. DEFAULT    ExeCtY(void);        /* execute a control-Y command */
  331. DEFAULT    ExeCtZ(void);        /* execute a control-Z command */
  332. DEFAULT    ExeD(void);        /* execute a D command */
  333. DEFAULT    ExeDgt(void);        /* execute a digit command */
  334. DEFAULT    ExeDot(void);        /* execute a dot (.) command */
  335. DEFAULT    ExeDQu(void);        /* execute a double-quote (") command */
  336. DEFAULT    ExeE(void);        /* execute on of the E commands */
  337. DEFAULT    ExeEqu(void);        /* execute an equals-sign (=) command */
  338. DEFAULT    ExeEsc(void);        /* execute an ESCAPE command */
  339. DEFAULT    ExeExc(void);        /* execute an exclamation-mark (!) command */
  340. DEFAULT    ExeEY(void);        /* execute an EY command */
  341. DEFAULT    ExeF(void);        /* execute one of the F commands */
  342. DEFAULT    ExeFB(void);        /* execute an FB command */
  343. DEFAULT    ExeG(void);        /* execute a G command */
  344. DEFAULT    ExeGtr(void);        /* execute a greater-than (>) command */
  345. DEFAULT    ExeH(void);        /* execute an H command */
  346. DEFAULT    ExeI(void);        /* execute an I command */
  347. DEFAULT    ExeIll(void);        /* execute an "illegal" command */
  348. DEFAULT    ExeJ(void);        /* execute a J command */
  349. DEFAULT    ExeK(void);        /* execute a K command */
  350. DEFAULT    ExeK(void);        /* execute a K command */
  351. DEFAULT    ExeL(void);        /* execute an L command */
  352. DEFAULT    ExeLBr(void);        /* execute a left-bracket ([) command */
  353. DEFAULT    ExeLst(void);        /* execute a less-than (<) command */
  354. DEFAULT    ExeM(void);        /* execute an M command */
  355. DEFAULT    ExeN(void);        /* execute a N command */
  356. DEFAULT    ExeNul(void);        /* execute a null command */
  357. DEFAULT    ExeNYI(void);        /* "not yet implemented" function */
  358. DEFAULT    ExeO(void);        /* execute an O command */
  359. DEFAULT    ExeOpr(void);        /* execute a operator (+,-,*, etc.) command */
  360. DEFAULT    ExeP(void);        /* execute a P or PW command */
  361. DEFAULT    ExePrc(void);        /* execute a percent {%} command */
  362. DEFAULT    ExePW(void);        /* execute a PW command */
  363. DEFAULT    ExeQ(void);        /* execute a Q command */
  364. DEFAULT    ExeQes(void);        /* execute a question-mark (?) command */
  365. DEFAULT    ExeR(void);        /* execute an R command */
  366. DEFAULT    ExeRBr(void);        /* execute a right-bracket (]) command */
  367. DEFAULT    ExeRtP(void);        /* execute a right-parenthesis command */
  368. DEFAULT    ExeS(void);        /* execute an S command */
  369. DEFAULT    ExeSCl(void);        /* execute a semi-colon (;) command */
  370. DEFAULT    ExeT(void);        /* execute a T command */
  371. DEFAULT    ExeU(void);        /* execute a U command */
  372. DEFAULT    ExeUnd(void);        /* execute an underbar (_) command */
  373. DEFAULT    ExeUsc(void);        /* execute control-_ command */
  374. DEFAULT    ExeV(void);        /* execute a V command */
  375. DEFAULT    ExeW(void);        /* execute a W command */
  376. DEFAULT    ExeX(void);        /* execute a X command */
  377. DEFAULT    ExeY(void);        /* execute a Y command */
  378. DEFAULT    ExeZ(void);        /* execute a Z command */
  379. DEFAULT    FindES(            /* find end of string */
  380.     unsigned char TrmChr);    /* termination char if no @ modifier */
  381. DEFAULT    FindQR(void);        /* find a q-register index */
  382. DEFAULT    FlowEC(void);        /* flow to end of conditional */
  383. DEFAULT    FlowEE(void);        /* flow to | or ' */
  384. DEFAULT    FlowEL(void);        /* flow to end of loop */
  385. DEFAULT    GetAra(void);        /* get m,n area */
  386. DEFAULT    GetNmA(void);        /* get numeric argument */
  387. DEFAULT    IncCBP(void);        /* increment CBfPtr */
  388. VVOID    Init(            /* initialize TECO-C */
  389.     int argc,
  390.     char *argv[]);
  391. DEFAULT    InsStr(            /* insert string into edit buffer */
  392.     charptr string,
  393.     ptrdiff_t length);
  394. BOOLEAN    IsRadx(            /* is the character in the radix set? */
  395.     unsigned char Charac);
  396. LONG    Ln2Chr(            /* convert line offset to character offset */
  397.     LONG Value);
  398. VVOID    MakDBf(            /* make digit buffer */
  399.     LONG Binary,        /* binary number to be converted */
  400.     DEFAULT NRadix);    /* radix to be used: 8, 10 or 16 */
  401. DEFAULT    MakRom(            /* make room in q-register */
  402.     SIZE_T Amount);        /* how much room to make */
  403. DEFAULT    PopMac(void);        /* pop variables after macro call */
  404. DEFAULT    PshMac(            /* push variables for macro call */
  405.     charptr Start,        /* start of new command string */
  406.     charptr End);        /* end of new command string, plus one */
  407. DEFAULT    PushEx(            /* push onto expression stack */
  408.     LONG Item,
  409.     DEFAULT EType);
  410. DEFAULT    RdLine(            /* read a line */
  411.     BOOLEAN *EBfFul);    /* returned "edit buffer is full" indicator */
  412. DEFAULT    RdPage(void);        /* read a page from a file */
  413. VVOID    ReadCS(void);        /* read command string */
  414. DEFAULT    Replac(void);        /* replace a string */
  415. DEFAULT    Search(            /* top level search */
  416.     BOOLEAN    RepCmd);    /* TRUE if the command has two arguments */
  417. DEFAULT    SinglP(void);        /* execute a single P function */
  418. DEFAULT    SkpCmd(void);        /* skip a single command */
  419. DEFAULT    SrcLop(void);        /* search loop */
  420. DEFAULT    SSerch(void);        /* single search */
  421. VVOID    TAbort(            /* terminate TECO-C */
  422.     DEFAULT tstat);
  423. VVOID    TypBuf(            /* type a buffer on the terminal */
  424.     charptr YBfBeg,
  425.     charptr YBfEnd);
  426. VVOID    TAbort(            /* cleanup for TECO-C abort */
  427.     DEFAULT tstat);
  428. VVOID    TypESt(void);        /* type error string on terminal */
  429. VVOID    UMinus(void);        /* handle unary minus */
  430. DEFAULT    WrPage(            /* write to output file */
  431.     DEFAULT    OfIndx,        /* index into OFiles array */
  432.     charptr OBfBeg,        /* address of output buffer beginning */
  433.     charptr OBfEnd,        /* address of output buffer end */
  434.     LONG AddFF);        /* -1 means add form feed, 0 means don't */
  435. voidptr ZAlloc(            /* like standard malloc function */
  436.     SIZE_T MemSiz);
  437. VVOID    ZBell(void);        /* ring the terminal bell */
  438. DEFAULT ZChIn(            /* input a character from the terminal */
  439.     BOOLEAN    NoWait);    /* return immediately? */
  440. LONG    ZClnEG(            /* execute special :EG command */
  441.     DEFAULT EGWhat,        /* what to get/set/clear: MEM, LIB, etc. */
  442.     DEFAULT EGOper,        /* operation: get, set or clear */
  443.     charptr TxtPtr);    /* if setting,  value to set */
  444. VVOID    ZClnUp(void);        /* cleanup for TECO-C abort */
  445. #if DEBUGGING || CONSISTENCY_CHECKING
  446. ULONG    Zcp2ul(            /* convert voidptr to unsigned long */
  447.     voidptr cp);
  448. #endif
  449. VVOID    ZDoCmd(void);        /* terminate and pass command string to OS */
  450. VVOID    ZDspBf(            /* output a buffer to the terminal */
  451.     charptr buffer,
  452.     SIZE_T length);
  453. VVOID    ZDspCh(            /* display a character */
  454.     char Charac);
  455. DEFAULT    ZExCtB(void);        /* execute a ^B command */
  456. DEFAULT    ZExCtH(void);        /* execute a ^H command */
  457. DEFAULT    ZExeEJ(void);        /* execute an EJ command */
  458. VVOID    ZExit(            /* terminate TECO-C */
  459.     DEFAULT estat);
  460. VVOID    ZFree(            /* like standard free() function */
  461.     voidptr pointer);
  462. DEFAULT    ZFrSrc(void);        /* forward search to match 1st character */
  463. VVOID    ZHelp(            /* display a help message */
  464.     charptr HlpBeg,        /* first char of help request */
  465.     charptr HlpEnd,        /* last character of help request */
  466.     BOOLEAN SysLib,        /* use default HELP library? */
  467.     BOOLEAN    Prompt);    /* enter interactive help mode? */
  468. VVOID    ZIClos(            /* close input file */
  469.     DEFAULT    IfIndx);    /* index into IFiles array */
  470. VVOID    ZOClDe(            /* close and delete output file */
  471.     DEFAULT    OfIndx);    /* index into OFiles array */
  472. VVOID    ZOClos(            /* close output file */
  473.     DEFAULT    OfIndx);    /* index into OFiles array */
  474. DEFAULT    ZOpInp(            /* open input file */
  475.     DEFAULT IfIndx,        /* index into file data block array IFiles */
  476.     BOOLEAN    EIFile,        /* is it a macro file? (hunt for it) */
  477.     BOOLEAN RepFNF);    /* report "file not found" error? */
  478. DEFAULT ZOpOut(            /* open output file */
  479.     DEFAULT    OfIndx,        /* output file indicator */
  480.     BOOLEAN RepErr);    /* report errors? */
  481. VVOID    ZPrsCL(            /* parse the command line */
  482.     int argc,
  483.     char **argv);
  484. DEFAULT    ZPWild(void);        /* preset the wildcard lookup filespec */
  485. voidptr    ZRaloc(            /* re-allocate memory*/
  486.     voidptr OldBlk,
  487.     SIZE_T NewSiz);
  488. DEFAULT ZRdLin(            /* read a line */
  489.     charptr ibuf,        /* where to put string */
  490.     ptrdiff_t ibuflen,    /* max length of buf */
  491.     int IfIndx,        /* index into IFiles[] */
  492.     DEFAULT *retlen);    /* returned length of string */
  493. VVOID    ZScrOp(            /* do a screen operation */
  494.     int OpCode);        /* code for operation */
  495. DEFAULT    ZSetTT(            /* set a terminal parameter */
  496.     DEFAULT TTWhat,        /* what terminal parameter to set */
  497.     DEFAULT TTVal);        /* new value for the terminal parameter */
  498. DEFAULT    ZSWild(void);        /* search for next wildcard filename */
  499. VVOID    ZTrmnl(void);        /* open terminal input and output */
  500. VVOID    ZVrbos(            /* display verbose form of an error message */
  501.     WORD ErrNum,        /* error number (see DEFERR.h) */
  502.     char *ErMnem);        /* error mnemonic */
  503. DEFAULT    ZWrBfr(            /* write a buffer */
  504.     DEFAULT    OfIndx,        /* index into OFiles array */
  505.     charptr BfrBeg,        /* address of output buffer beginning */
  506.     charptr BfrEnd);    /* address of output buffer end */
  507.  
  508.  
  509. #else                /* else (not USE_PROTOTYPES) */
  510.  
  511. #if CHECKSUM_CODE
  512. VVOID    init_code_checksums ();
  513. VVOID    check_code_checksums ();
  514. #endif
  515.  
  516. #if CONSISTENCY_CHECKING
  517. VVOID    init_consistency_check();
  518. VVOID    check_consistency();
  519. #endif
  520.  
  521. DEFAULT    BakSrc();    /* backwards search to match 1st character */
  522. DEFAULT    BldStr();    /* build a string */
  523. VVOID    ClenUp();    /* clean up for TECO-C abort */
  524. DEFAULT    CMatch();    /* match a character */
  525. #if DEBUGGING
  526. DEFAULT    DbgDsp();    /* debugging, control debugging display */
  527. VVOID    DbgFEn();    /* debugging, function entry */
  528. VVOID    DbgFEx();    /* debugging, function exit */
  529. VVOID    DbgFMs();    /* debugging, function message */
  530. #endif
  531. DEFAULT    DoCJR();    /* do C, J or R stuff */
  532. VVOID    DoEvEs();    /* do an EV or ES mode control flag function */
  533. DEFAULT    DoFlag();    /* handle mode control flag */
  534. VVOID    EchoIt();    /* echo a character to to terminal */
  535. VVOID    ErrChr();    /* display error message with character argument */
  536. VVOID    ErrMsg();    /* display error message */
  537. VVOID    ErrPSt();    /* display error message with string argument */
  538. VVOID    ErrStr();    /* display error message with string argument */
  539. VVOID    ErrUTC();    /* unterminated command or macro */
  540. VVOID    ErrVrb();    /* display a verbose error message */
  541. DEFAULT    ExeA();        /* execute an A command */
  542. DEFAULT    ExeAtS();    /* execute an at-sign (@) command */
  543. DEFAULT    ExeB();        /* execute a B command */
  544. DEFAULT    ExeBar();    /* execute a bar (|) command */
  545. DEFAULT    ExeBSl();    /* execute a backslash (\) command */
  546. DEFAULT    ExeC();        /* execute a C command */
  547. DEFAULT    ExeCCC();    /* execute a control-^ command */
  548. DEFAULT    ExeCln();    /* execute a colon (:) command */
  549. DEFAULT    ExeCom();    /* execute a comma (,) command */
  550. DEFAULT    ExeCrt();    /* execute a caret (^) command */
  551. DEFAULT    ExeCSt();    /* execute a command string */
  552. DEFAULT    ExeCtA();    /* execute a control-A command */
  553. DEFAULT    ExeCtC();    /* execute a control-C command */
  554. DEFAULT    ExeCtD();    /* execute a control-D command */
  555. DEFAULT    ExeCtE();    /* execute a control-E command */
  556. DEFAULT    ExeCtI();    /* execute a control-I (tab) command */
  557. DEFAULT    ExeCtL();    /* execute a control-L (form feed) command */
  558. DEFAULT    ExeCtN();    /* execute a control-N command */
  559. DEFAULT    ExeCtO();    /* execute a control-O command */
  560. DEFAULT    ExeCtP();    /* execute a control-P command */
  561. DEFAULT    ExeCtQ();    /* execute a control-Q command */
  562. DEFAULT    ExeCtR();    /* execute a control-R command */
  563. DEFAULT    ExeCtS();    /* execute a control-S command */
  564. DEFAULT    ExeCtT();    /* execute a control-T command */
  565. DEFAULT    ExeCtU();    /* execute a control-U command */
  566. DEFAULT    ExeCtV();    /* execute a control-V command */
  567. DEFAULT    ExeCtW();    /* execute a control-W command */
  568. DEFAULT    ExeCtX();    /* execute a control-X command */
  569. DEFAULT    ExeCtY();    /* execute a control-Y command */
  570. DEFAULT    ExeCtZ();    /* execute a control-Z command */
  571. DEFAULT    ExeD();        /* execute a D command */
  572. DEFAULT    ExeDgt();    /* execute a digit command */
  573. DEFAULT    ExeDot();    /* execute a dot (.) command */
  574. DEFAULT    ExeDQu();    /* execute a double-quote (") command */
  575. DEFAULT    ExeE();        /* execute on of the E commands */
  576. DEFAULT    ExeEqu();    /* execute an equals-sign (=) command */
  577. DEFAULT    ExeEsc();    /* execute an ESCAPE command */
  578. DEFAULT    ExeExc();    /* execute an exclamation-mark (!) command */
  579. DEFAULT    ExeEY();    /* execute an EY command */
  580. DEFAULT    ExeF();        /* execute one of the F commands */
  581. DEFAULT    ExeFB();    /* execute an FB command */
  582. DEFAULT    ExeG();        /* execute a G command */
  583. DEFAULT    ExeGtr();    /* execute a greater-than (>) command */
  584. DEFAULT    ExeH();        /* execute an H command */
  585. DEFAULT    ExeI();        /* execute an I command */
  586. DEFAULT    ExeIll();    /* execute an "illegal" command */
  587. DEFAULT    ExeJ();        /* execute a J command */
  588. DEFAULT    ExeK();        /* execute a K command */
  589. DEFAULT    ExeK();        /* execute a K command */
  590. DEFAULT    ExeL();        /* execute an L command */
  591. DEFAULT    ExeLBr();    /* execute a left-bracket ([) command */
  592. DEFAULT    ExeLst();    /* execute a less-than (<) command */
  593. DEFAULT    ExeM();        /* execute an M command */
  594. DEFAULT    ExeN();        /* execute a N command */
  595. DEFAULT    ExeNul();    /* execute a null command */
  596. DEFAULT    ExeNYI();    /* "not yet implemented" function */
  597. DEFAULT    ExeO();        /* execute an O command */
  598. DEFAULT    ExeOpr();    /* execute a operator (+,-,*, etc.) command */
  599. DEFAULT    ExeP();        /* execute a P or PW command */
  600. DEFAULT    ExePrc();    /* execute a percent {%} command */
  601. DEFAULT    ExePW();    /* execute a PW command */
  602. DEFAULT    ExeQ();        /* execute a Q command */
  603. DEFAULT    ExeQes();    /* execute a question-mark (?) command */
  604. DEFAULT    ExeR();        /* execute an R command */
  605. DEFAULT    ExeRBr();    /* execute a right-bracket (]) command */
  606. DEFAULT    ExeRtP();    /* execute a right-parenthesis command */
  607. DEFAULT    ExeS();        /* execute an S command */
  608. DEFAULT    ExeSCl();    /* execute a semi-colon (;) command */
  609. DEFAULT    ExeT();        /* execute a T command */
  610. DEFAULT    ExeU();        /* execute a U command */
  611. DEFAULT    ExeUnd();    /* execute an underbar (_) command */
  612. DEFAULT    ExeUsc();    /* execute control-_ command */
  613. DEFAULT    ExeV();        /* execute a V command */
  614. DEFAULT    ExeW();        /* execute a W command */
  615. DEFAULT    ExeX();        /* execute a X command */
  616. DEFAULT    ExeY();        /* execute a Y command */
  617. DEFAULT    ExeZ();        /* execute a Z command */
  618. DEFAULT    FindES();    /* find end of string */
  619. DEFAULT    FindQR();    /* find a q-register index */
  620. DEFAULT    FlowEC();    /* flow to end of conditional */
  621. DEFAULT    FlowEE();    /* flow to | or ' */
  622. DEFAULT    FlowEL();    /* flow to end of loop */
  623. DEFAULT    GetAra();    /* get m,n area */
  624. DEFAULT    GetNmA();    /* get numeric argument */
  625. DEFAULT    IncCBP();    /* increment CBfPtr */
  626. VVOID    Init();        /* initialize TECO-C */
  627. DEFAULT    InsStr();    /* insert string into edit buffer */
  628. BOOLEAN    IsRadx();    /* is the character in the radix set? */
  629. LONG    Ln2Chr();    /* convert line offset to character offset */
  630. VVOID    MakDBf();    /* make digit buffer */
  631. DEFAULT    MakRom();    /* make room in q-register */
  632. DEFAULT    PopMac();    /* pop variables after macro call */
  633. DEFAULT    PshMac();    /* push variables for macro call */
  634. DEFAULT    PushEx();    /* push onto expression stack */
  635. DEFAULT    RdLine();    /* read a line */
  636. DEFAULT    RdPage();    /* read a page from a file */
  637. VVOID    ReadCS();    /* read command string */
  638. DEFAULT    Replac();    /* replace a string */
  639. DEFAULT    Search();    /* top level search */
  640. DEFAULT    SinglP();    /* execute a single P function */
  641. DEFAULT    SkpCmd();    /* skip a single command */
  642. DEFAULT    SrcLop();    /* search loop */
  643. DEFAULT    SSerch();    /* single search */
  644. VVOID    TAbort();    /* terminate TECO-C */
  645. VVOID    TypBuf();    /* type a buffer on the terminal */
  646. VVOID    TypESt();    /* type error string on terminal */
  647. VVOID    UMinus();    /* handle unary minus */
  648. DEFAULT    WrPage();    /* write to output file */
  649. voidptr ZAlloc();    /* like standard malloc function */
  650. VVOID    ZBell();    /* ring the terminal bell */
  651. DEFAULT ZChIn();    /* input a character from the terminal */
  652. LONG    ZClnEG();    /* execute special :EG command */
  653. VVOID    ZClnUp();    /* cleanup for TECO-C abort */
  654. #if DEBUGGING || CONSISTENCY_CHECKING
  655. ULONG    Zcp2ul();    /* convert charptr to unsigned long */
  656. #endif
  657. VVOID    ZDoCmd();    /* terminate and pass command string to OS */
  658. VVOID    ZDspBf();    /* output a buffer to the terminal */
  659. VVOID    ZDspCh();    /* display a character */
  660. DEFAULT    ZExCtB();    /* execute a ^B command */
  661. DEFAULT    ZExCtH();    /* execute a ^H command */
  662. DEFAULT    ZExeEJ();    /* execute an EJ command */
  663. VVOID    ZExit();    /* terminate TECO-C */
  664. VVOID    ZFree();    /* like standard free() function */
  665. DEFAULT    ZFrSrc();    /* forward search to match 1st character */
  666. VVOID    ZHelp();    /* display a help message */
  667. VVOID    ZIClos();    /* close input file */
  668. VVOID    ZOClDe();    /* close and delete output file */
  669. VVOID    ZOClos();    /* close output file */
  670. DEFAULT    ZOpInp();    /* open input file */
  671. DEFAULT ZOpOut();    /* open output file */
  672. VVOID    ZPrsCL();    /* parse the command line */
  673. DEFAULT    ZPWild();    /* preset the wildcard lookup filespec */
  674. voidptr    ZRaloc();    /* re-allocate memory*/
  675. DEFAULT    ZRdLin();    /* read a line */
  676. VVOID    ZScrOp();    /* do a screen operation */
  677. DEFAULT    ZSetTT();    /* set a terminal parameter */
  678. DEFAULT    ZSWild();    /* search for next wildcard filename */
  679. VVOID    ZTrmnl();    /* open terminal input and output */
  680. VVOID    ZVrbos();    /* display verbose form of an error message */
  681. DEFAULT    ZWrBfr();    /* write line to file */
  682. #endif
  683. #if CURSES
  684. void Scope();
  685. void centre();
  686. void dolf();
  687. void dobs();
  688. void ccs();
  689. void do_right();
  690. void do_left();
  691. void do_sf();
  692. void do_sr();
  693. void do_down();
  694. void do_up();
  695. void do_seetog();
  696. void redraw();
  697. void keypad_on();
  698. void keypad_off();
  699. #endif
  700.